import request from "@/utils/request.js";
import Constants from "@/const"

const url = '/cloud-sys-service/sys-log'

/**
 * 获取日志分页列表
 */
export function list(data) {
	return request({
		url: url + "/list",
		method: "post",
		data,
	})
}

// 列表相关列信息
export const columnInfo = [
	{
		"title":"序号",
		"type":"seq",
		"fixed":"left",
		"align":"center",
		"width":"60"
	},
	{
		"type":"checkbox",
		"fixed":"left",
		"align":"center",
		"width":"60"
	},
	{
		"title":"功能描述",
		"field":"title",
		"fixed":"left",
		"align":"center",
		"minWidth":"100"
	},
	{
		"title":"操作人员",
		"field":"createByTxt",
		"fixed":"left",
		"align":"center",
		"minWidth":"100"
	},
	{
		"title":"操作类型",
		"field":"businessType",
		"align":"center",
		"formatter": ["formatCode", Constants.LOG_BUSINESS_TYPE],
		"proxyColumn":true,
		"minWidth":"100"
	},
	{
		"title":"请求方式",
		"field":"requestMethod",
		"align":"center",
		"minWidth":"80"
	},
	{
		"title":"请求方法",
		"field":"method",
		"align":"center",
		"minWidth":"250"
	},
	{
		"title":"请求URL",
		"field":"url",
		"align":"center",
		"minWidth":"250"
	},
	{
		"title":"请求参数",
		"field":"params",
		"align":"center",
		"showOverflow":"title",
		"minWidth":"250"
	},
	{
		"title":"状态",
		"field":"status",
		"align":"center",
		"proxyColumn":true,
		"formatter": ["formatCode", Constants.LOG_STATUS_TYPE],
		"minWidth":"80"
	},
	{
		"title":"返回内容",
		"field":"result",
		"align":"center",
		"showOverflow":"title",
		"minWidth":"150"
	},
	{
		"title":"IP",
		"field":"ip",
		"align":"center",
		"minWidth":"120"
	},
	{
		"title":"IP归属地",
		"field":"address",
		"align":"center",
		"minWidth":"120"
	},
]
